import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home/Home.vue'
const routes = [
  {
    path: '/films',
    name: 'Home',
    component: Home,
    children:[{
      path:"inTheaters",
      component: () => import('../views/Films/inTheaters.vue')
    },
    {
      path:"commingSoon",
      component: () => import('../views/Films/commingSoon.vue')
    }
  ]},
  {
    path: '/',
   redirect:"/films/inTheaters"
  //  路由重定向
  },
  {
    path:"/detail",
    component: () => import('../views/Detail/index.vue')
  },{
    path:"/city",
    component: () => import('../views/City/index.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
